package com.rjj.wlqq.tool.excel.html;

import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

/**
 * 可以把html中的table变成excel，嵌套不嵌套都可以
 *
 * @ClassName:HtmlToExcel
 * @Description: 传入html代码字符串，返回POI的工作簿对象HSSFWorkbook
 *  https://blog.csdn.net/qinchaozengh/article/details/44493461
 *
 *
 *
 *   主要格式
 *  *   <table>
 *  *       <tr>
 *              <th></th>
 *              <th></th>
 *              <th></th>
 *          </tr>
 *  *       <tr>
 *              <td colspan='2'></td>
 *              <td colspan='2'></td>
 *              <td>
*                   <tr>
 *                       <td></td>
*                   </tr>
 *                  <tr>
 *                      <td></td>
 *                  </tr>
*                </td>
 *          </tr>
 *  *       <tr>
 *              <td></td>
 *              <td></td>
 *              <td></td>
 *          </tr>
 *  *   </table>
 *
 *
 *
 *
 *
 *         * 错误格式
 *         *
 *         *  <table>
 *         *      <thead>
 *         *          <tr>
 *         *              <td></td>
 *         *              <td></td>
 *         *              <td></td>
 *         *              <td></td>
 *         *          </tr>
 *         *      </thead>
 *         *      <tbody>
 *         *          <body>
 *         *              <tr>
 *         *                  <td></td>
 *         *                  <td></td>
 *         *                  <td></td>
 *         *                  ********
 *         *              </tr>
 *         *          </body>
 *         *      </tbody>
 *         *  </table>
 *         *
 *         *  表头中的td数量和表体中的td数量不一样，所以会导致报数组下标越界
 *         *
 */
public class HtmlToExcel {
    private static final String XLS = "xls";
    /**表格的列数*/
    private  int columnSize;
    /**表格的行数*/
    private  int rowSize;
    /**数据的行数，不含表头*/
    private  int rowSize_data;
    /**标题所占行数*/
    private int rowSize_title=1;
    /**表头所占行数*/
    private int rowSize_header;
    /**工作表名称*/
    private String sheetName;

    public HtmlToExcel(int rowSize_title,String sheetName){
        this.rowSize_title=rowSize_title;
        this.sheetName=sheetName;
    }

    public HtmlToExcel(int rowSize_title){
        this.rowSize_title=rowSize_title;
    }

    public HtmlToExcel(){
    }

    /**
     * 共给外部使用的导出Excel方法
     *
     * @param response 相应方法
     * @param htmlStr  html内容
     * @param fileName 导出的文件名称，后缀名称可以添加也可以不添加xls
     *
     * 使用
     *      HtmlToExcel htmlToExcel = new HtmlToExcel(1, "sheet");
     *      htmlToExcel.htmlToExcel(response, request, html, downloadFileName);
     */
    public void htmlToExcel(HttpServletResponse response, HttpServletRequest request, String htmlStr, String fileName) {
        if (StringUtils.isNotBlank(htmlStr)) {
            try {
                HtmlToExcel htmlToExcel = new HtmlToExcel(1, fileName);
                HSSFWorkbook wb = htmlToExcel.readHtmlStr(htmlStr);


                response.setHeader("Content-Disposition", "attachment; " + encodeFileName(request, fileName));
                ServletOutputStream fOut = response.getOutputStream();

                wb.write(fOut);
                fOut.flush();
                fOut.close();

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * 输出excel
     * @param out 输出流
     * @param htmlStr html字符串
     * @param sheetName  sheetName名称
     */
    public void htmlToExcel(OutputStream out, String htmlStr, String sheetName) {
        if(StringUtils.isNotBlank(htmlStr)){
            try{
                HtmlToExcel htmlToExcel=new HtmlToExcel(1,sheetName);
                HSSFWorkbook wb= htmlToExcel.readHtmlStr(htmlStr);
                wb.write(out);
                out.flush();
                out.close();
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * @Title : readHtmlStr 读取html数据
     * @param htmlStr html数据
     * @Description : 使用jsoup解析html，得到表头数据List，表体数据String[][]
     */
    public  HSSFWorkbook readHtmlStr(String htmlStr) {
        Document doc = Jsoup.parseBodyFragment(htmlStr, "utf-8");
        doc.select("input[type$=hidden]").remove();//删除所有input隐藏域
        doc.select("tr[style*=none]").remove();//删除隐藏的tr

        Elements captions=doc.getElementsByTag("caption");//查找表头
        String tableTitle="";// 保存表头标题
        if(captions!=null&&captions.size()>0){
            Element caption=captions.get(0);
            tableTitle=caption.text();
        }else{
            rowSize_title=0;//表示，没有表头
        }

        Elements trs_data = doc.getElementsByTag("tr");//获取所有tr
        rowSize= trs_data.size()+rowSize_title;//获取表格的行数，外加标题行数

        Elements theads=doc.getElementsByTag("thead");//表头thead标签

        List<TD>finalHeaderList= new ArrayList<>();//存放推导完毕的正确数据

        List<TD>dataList = new ArrayList<>();//表头1单元格List
        if(theads!=null&&theads.size()>0){//表示有表头
            Elements thead_trs=theads.get(0).getElementsByTag("tr");//表头中的tr
            rowSize_header=thead_trs.size();
            trs_data.removeAll(thead_trs);//移除表头中的的tr元素，trs中剩下数据行

            List<TD>headerList = new ArrayList<>();//表头1单元格List
            //构造表头
            //将表头数据存到List中。x、y坐标从0开始
            //确定x坐标之1：横向推导
            int basicY_thead=rowSize_title;
            for(int i=0;i<thead_trs.size();i++){
                Element thead_tr=thead_trs.get(i);
                Elements thead_tr_ths=thead_tr.getElementsByTag("th");
                for (Element e : thead_tr_ths) {
                    TD td = new TD();
                    td.setContent(e.text());
                    if (StringUtils.isNotBlank(e.attr("colspan"))) {
                        td.setColspan(Integer.valueOf(e.attr("colspan").trim()));
                    }
                    if (StringUtils.isNotBlank(e.attr("rowspan"))) {
                        td.setRowspan(Integer.valueOf(e.attr("rowspan").trim()));
                    }
                    td.setX(HorizontalDeduction_th(e));//步骤1：横向推导，但这个坐标并不是最终坐标，需要进行纵向推导
                    td.setY(i + basicY_thead);//y坐标很简单，就是tr的值
                    headerList.add(td);
                }
            }
            //确定x坐标之2：纵向推导
            finalHeaderList = verticalDeduction(headerList);

            if(trs_data.size()>0){//表示有表格内容数据
                rowSize_data=trs_data.size();
            }else{//表示只有表头数据，没有表格内容数据
                rowSize_data=0;
            }

        }else{//表示没有表头
            rowSize_header=0;
        }
        //循环每一个数据单元格
        int basicY_data=rowSize_title+rowSize_header;
        for(int i = 0; i < trs_data.size(); i++) {
            Element tr = trs_data.get(i);
            Elements tds = tr.getElementsByTag("td");
            //循环每一行的所有列
            for (Element e : tds) {
                Elements inp = e.getElementsByTag("input");
                TD td = new TD();
                if (StringUtils.isNotBlank(e.attr("colspan"))) {
                    td.setColspan(Integer.valueOf(e.attr("colspan").trim()));
                }
                if (StringUtils.isNotBlank(e.attr("rowspan"))) {
                    td.setRowspan(Integer.valueOf(e.attr("rowspan").trim()));
                }
                if (inp != null && inp.size() > 0) {//表示td中嵌套input
                    td.setContent(inp.get(0).val());
                } else {//表示td中没有嵌套input
                    td.setContent(e.text().trim());
                }
                td.setX(HorizontalDeduction_td(e));//步骤1：横向推导，但这个坐标并不是最终坐标，需要进行纵向推导
                td.setY(i + basicY_data);//y坐标很简单，就是tr的值
                dataList.add(td);
            }
        }
        //步骤2：纵向推导
        dataList=verticalDeduction(dataList);

        //表头和表内容合并为一个List
        finalHeaderList.addAll(dataList);

        //对列进行赋值，找到第一个单元格计算列宽
        TD lastTd=finalHeaderList.get(finalHeaderList.size()-1);
        columnSize=lastTd.getX()+lastTd.getColspan();

        int[][]contextSizeArr=new int[rowSize][columnSize];//记录内容单元格内容长度，便于进行列宽自适应调整
        String[][]dataArr=new String[rowSize_data][columnSize];
        //将表格的长度按照该单元格的位置填入字符串长度
        //不能使用普通下标方式赋值，因为如果有合并单元格的情况，数组的位置就会错位，使用坐标保证不会错位
        for (TD td : finalHeaderList) {
            contextSizeArr[td.getY()][td.getX()] = getStringLength(td.getContent()) + 1;
        }
        int[]maxLengthArr = getMaxLength(contextSizeArr);

        //根据解析到的数据返回POI的Excel对象
        return buildExcel(tableTitle,finalHeaderList,dataArr,maxLengthArr);
    }

    /**
     * @Title : getStringLength 获取长度
     * @Description : 中文字符与非中文字符长度计算
     */
    private int getStringLength(String s) {
        double valueLength = 0;
        String chinese ="[\u4e00-\u9fa5]";
        // 获取字段值的长度，如果含中文字符，则每个中文字符长度为2，否则为1
        for (int i = 0; i < s.length(); i++){
            // 获取一个字符
            String temp = s.substring(i, i +1);
            // 判断是否为中文字符
            if (temp.matches(chinese)) {
                // 中文字符长度为1
                valueLength += 1;
            } else {
                // 其他字符长度为0.5
                valueLength += 0.5;
            }
        }
        //进位取整
        return (int) Math.ceil(valueLength);
    }
    /**
     * @Title : getMaxLength 获取最大长度
     * @Description : 竖向遍历二维数组，找到每一列的最大值
     * @param contextSizeArr 内容
     */
    private int[] getMaxLength(int[][] contextSizeArr) {
        int[]maxArr=new int[columnSize];
        for(int i=0;i<columnSize;i++){
            int basic=0;
            for(int j=0;j<rowSize;j++){
                if(contextSizeArr[j][i]>basic){//注意下标的写法
                    basic=contextSizeArr[j][i];
                }
            }
            maxArr[i]=basic;
        }
        return maxArr;
    }
    /**
     * @Title : HorizontalDeduction
     * @Description : 使用递归，进行横坐标的第一步推导，横向推导，同时删除多余的非td元素
     */
    private  int HorizontalDeduction_td(Element e) {
        Element preElement=e.previousElementSibling();
        if(preElement!=null){
            if(!"td".equals(preElement.tagName())){//表示td的上一个兄弟节点不是td，则删除这个多余的元素
                preElement.remove();
            }else{
                int nColSpan=1;//默认为1
                if(StringUtils.isNotBlank(preElement.attr("colspan"))){
                    nColSpan=Integer.valueOf(preElement.attr("colspan").trim());//前一个元素的列合并情况
                }
                return HorizontalDeduction_td(preElement) + nColSpan;
            }
        }
        return 0;
    }

    /**
     * @Title : HorizontalDeduction
     * @Description : 使用递归，进行横坐标的第一步推导，横向推导，同时删除多余的非td元素
     */
    private  int HorizontalDeduction_th(Element e) {
        Element preElement=e.previousElementSibling();
        if(preElement!=null){
            if(!"th".equals(preElement.tagName())){//表示td的上一个兄弟节点不是td，则删除这个多余的元素
                preElement.remove();
            }else{
                int nColSpan=1;//默认为1
                if(StringUtils.isNotBlank(preElement.attr("colspan"))){
                    nColSpan=Integer.valueOf(preElement.attr("colspan").trim());//前一个元素的列合并情况
                }
                return HorizontalDeduction_th(preElement) + nColSpan;
            }
        }
        return 0;
    }

    /**
     * @Title : verticalDeduction
     * @Description : 纵向推导
     */
    private List<TD> verticalDeduction(List<TD> headerList) {
        int headerSize = headerList.size();
        for(int i = 0; i < headerSize; i++) {
            TD tdA = headerList.get(i);
            boolean flag = true;
            while(flag) {// 不断排列当前节点的位置，直到它的位置绝对正确
                flag= false;// 不需要移位
                for(int j = i - 1; j >= 0; j--) {// 找到之前与td的横坐标相等的值
                    TD tdB = headerList.get(j);
                    if(tdA.getX() == tdB.getX()) {// A找到与其X坐标相等的B
                        if(tdB.getRowspan() > tdA.getY() - tdB.getY()) {// 如果B单元格“挡住”了A单元格，才进行移位操作。即：只有B占的行数大于或等于A、B之间的距离，那么B才会挡住A
                            flag= true;// 如果存在移位单元格，则仍然需要重新判断当前的位置是否正确。需要移位
                            tdA.setX(tdA.getX()+ tdB.getColspan());// A的X坐标向后推B.colspan的位置
                            int YA = tdA.getY();
                            for(int m = i + 1; m < headerSize; m++) {// 同时，与A同处一tr但在其后边的td节点均应向后推B.colspan个位移
                                TD td = headerList.get(m);
                                if(td.getY() == YA) {
                                    td.setX(td.getX()+ tdB.getColspan());
                                }
                            }
                        }
                    }
                }
            }
        }
        return headerList;
    }
    /**
     * @Description : 依据传入的数据生成Excel文件
     * @param finalHeaderList 表格表头数据
     */
    private  HSSFWorkbook buildExcel(String title,List<TD> finalHeaderList,String[][] dataArr,int[] maxLengthArr) {
        HSSFWorkbook wb=new HSSFWorkbook();
        HSSFSheet sheet;
        if(StringUtils.isNotBlank(sheetName)){
            sheet=wb.createSheet(sheetName);
        }else if(StringUtils.isNotBlank(title)){
            sheet=wb.createSheet("title");
        }else{
            sheet=wb.createSheet("Sheet1");
        }

        //表格样式
        //1、基础样式
        HSSFCellStyle basicStyle=wb.createCellStyle();
        basicStyle.setAlignment(HorizontalAlignment.CENTER);//设置水平居中
        basicStyle.setVerticalAlignment(VerticalAlignment.CENTER);    //设置垂直居中

        basicStyle.setBorderBottom(BorderStyle.THICK);// 下边框
        basicStyle.setBorderLeft(BorderStyle.THICK);//左边框
        basicStyle.setBorderTop(BorderStyle.THICK);//上边框
        basicStyle.setBorderRight(BorderStyle.THICK);//右边框
        //2、标题样式
        HSSFCellStyle titleStyle=wb.createCellStyle();
        titleStyle.setAlignment(HorizontalAlignment.CENTER);//设置水平居中
        titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);    //设置垂直居中

        HSSFFont headerFont1 = wb.createFont();
        headerFont1.setBold(true);//设置字体加粗
        headerFont1.setFontHeightInPoints((short)14);//设置字体大小
        titleStyle.setFont(headerFont1);
        //3、偶数行样式
        HSSFCellStyle evenStyle=wb.createCellStyle();
        evenStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        evenStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
        evenStyle.setAlignment(HorizontalAlignment.CENTER);

        HSSFCellStyle oldStyle=wb.createCellStyle();
        oldStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        oldStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex());
        oldStyle.setAlignment(HorizontalAlignment.CENTER);

        //构建基本空白表格
        for(int i=0;i<rowSize;i++){
            sheet.createRow(i);
            for(int j=0;j<columnSize;j++){
                sheet.getRow(i).createCell(j).setCellStyle(basicStyle);
            }
        }
        //填充数据
        if(rowSize_title!=0){
            //1、标题
            HSSFCell cell=sheet.getRow(0).getCell(0);
            cell.setCellStyle(titleStyle);
            cell.setCellValue(title);
            //单元格合并
            sheet.addMergedRegion(new CellRangeAddress(0,rowSize_title-1,0,columnSize-1));//起始行，终止行，起始列，终止列
        }
        //2、表头、单元格数据内容写入
        for (TD td : finalHeaderList) {
            sheet.getRow(td.getY()).getCell(td.getX()).setCellValue(td.getContent());
            //单元格合并
            sheet.addMergedRegion(
                    new CellRangeAddress(//起始行，终止行，起始列，终止列
                            td.getY(),
                            td.getY() + (td.getRowspan() - 1),
                            td.getX(),
                            td.getX() + (td.getColspan() - 1))
            );
        }

        //3、设置每一列宽度以该列的最长内容为准
        for(int i=0;i<maxLengthArr.length;i++){
            //每一行的文字的内容可能宽度不同，那么这里会变化很大，所以会出问题The maximum column width for an individual cell is 255 characters.
            //sheet.setColumnWidth(i,maxLengthArr[i]*2*235);

            //解决方案：可以设置一个固定的值，但是excel中所有的列都是不同的宽度的，又的列很小的，所以这里区分一下，
            int colWidth = sheet.getColumnWidth(i)*2;
            if(colWidth<255*256){
                sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth);
            }else{
                sheet.setColumnWidth(i,6000 );
            }
        }

        for(int i=0;i<rowSize;i++){
            HSSFRow row =sheet.getRow(i);
            row.setHeightInPoints(row.getHeightInPoints()+3);
        }
        return wb;
    }

    /**
     * 依据浏览器判断编码规则
     */
    private static String encodeFileName(HttpServletRequest request, String fileName) {
        String userAgent = request.getHeader("User-Agent");

        fileName = handlerFileSuffix(fileName);

        try {
            String encodedFileName = URLEncoder.encode(fileName, "UTF8");
            // 如果没有UA，则默认使用IE的方式进行编码
            if (null == userAgent) {
                return "filename=\"" + encodedFileName + "\"";
            }

            userAgent = userAgent.toLowerCase();
            // IE浏览器，只能采用URLEncoder编码
            if (userAgent.contains("msie")) {
                return "filename=\"" + encodedFileName + "\"";
            }

            // Opera浏览器只能采用filename*
            if (userAgent.contains("opera")) {
                return "filename*=UTF-8''" + encodedFileName;
            }

            // Safari浏览器，只能采用ISO编码的中文输出,Chrome浏览器，只能采用MimeUtility编码或ISO编码的中文输出
            if (userAgent.contains("safari") || userAgent.contains("applewebkit") || userAgent.contains("chrome")) {
                return "filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\"";
            }

            // FireFox浏览器，可以使用MimeUtility或filename*或ISO编码的中文输出
            if (userAgent.contains("mozilla")) {
                return "filename*=UTF-8''" + encodedFileName;
            }

            return "filename=\"" + encodedFileName + "\"";
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * 处理文件名称后缀
     *
     * @param fileName 文件名称【当前只是xls】
     */
    private static String handlerFileSuffix(String fileName) {
        if (!fileName.contains(XLS)) {
            fileName += ".xls";
        }
        return fileName;
    }

    /**
     * 测试方法
     */
    public static void main(String[] args) {
        String ss = "<!DOCTYPE html>\n" +
                "<html>\n" +
                "<head>\n" +
                "    <meta charset=\"UTF-8\" />\n" +
                "    <title>1</title>\n" +
                "</head>\n" +
                "<body topmargin=\"0\" leftmargin='0' >\n" +
                "<table border='1' cellspacing=\"0\" cellpadding=\"0\" >\n" +
                "\t<thead>\n" +
                "\t\t<tr>\n" +
                "            <th>序号</th>\n" +
                "\t\t\t<th>校区</th>\n" +
                "\t\t\t<th>销售来源</th>\n" +
                "\t\t\t<th>二级来源</th>\n" +
                "\t\t\t<th>三级来源</th>\n" +
                "\t\t\t<th> 录入日期</th>\n" +
                "\t\t\t<th>家长姓名</th>\n" +
                "\t\t\t<th>电话</th>\n" +
                "\t\t\t<th>微信号</th>\n" +
                "            <th>学生姓名</th>\n" +
                "\t\t\t<th>性别</th><!-- 性别 -->\n" +
                "\t\t\t<th>年龄</th>\n" +
                "\t\t\t<th>就读学校</th>\n" +
                "\t\t\t<th>所在年级</th>\n" +
                "\t\t\t<th>课程顾问</th>\n" +
                "\t\t\t<th>科目</th>\n" +
                "\t\t\t<th>客户等级</th>\n" +
                "\t\t\t<th>线索状态</th>\n" +
                "\t\t\t<th>回访顾问</th>\n" +
                "\t\t\t<th>回访时间</th>\n" +
                "\t\t\t<th>回访结果</th>\n" +
                "\t\t\t<th>回访内容</th>\n" +
                "\t\t\t<th>订单编号</th>\n" +
                "\t\t\t<th>科目</th>\n" +
                "\t\t\t<th>实收金额</th>\n" +
                "\t\t</tr>\n" +
                "\t</thead>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">1</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">400电话</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京400</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-25</td>\n" +
                "\t\t\t<td rowspan=\"1\">李媛</td>\n" +
                "\t\t\t<td rowspan=\"1\">15015888</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">b JIAO // 棣</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">7</td>\n" +
                "            <td rowspan=\"1\">小CBD分校</td>\n" +
                "            <td rowspan=\"1\">1</td>\n" +
                "\t\t\t<td rowspan=\"1\">Ying 樱</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">ESL</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">2</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-25</td>\n" +
                "\t\t\t<td rowspan=\"1\">红</td>\n" +
                "\t\t\t<td rowspan=\"1\">13671020016</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Cleo 可</td>\n" +
                "\t\t\t<td rowspan=\"1\">女</td>\n" +
                "            <td rowspan=\"1\">11</td>\n" +
                "            <td rowspan=\"1\">北京学朝阳学校</td>\n" +
                "            <td rowspan=\"1\">6</td>\n" +
                "\t\t\t<td rowspan=\"1\">Ying Z</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-25</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>对TIE课程感兴趣，已经安排了本周六下午3点线上测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">3</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">Nini介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">Nini</td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-25</td>\n" +
                "\t\t\t<td rowspan=\"1\">Hen</td>\n" +
                "\t\t\t<td rowspan=\"1\">1366925</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">KEVIN奕博</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">11</td>\n" +
                "            <td rowspan=\"1\">Fangcaodi International School </td>\n" +
                "            <td rowspan=\"1\">5</td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie 华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">夏校咨询</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">4</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-23</td>\n" +
                "\t\t\t<td rowspan=\"1\">丹</td>\n" +
                "\t\t\t<td rowspan=\"1\">1366973</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Vicky 扬</td>\n" +
                "\t\t\t<td rowspan=\"1\">女</td>\n" +
                "            <td rowspan=\"1\">13</td>\n" +
                "            <td rowspan=\"1\">学校</td>\n" +
                "            <td rowspan=\"1\">7</td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie 华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">未跟进\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">5</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-23</td>\n" +
                "\t\t\t<td rowspan=\"1\">褚含</td>\n" +
                "\t\t\t<td rowspan=\"1\">182333</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Alice CHU // 褚彤</td>\n" +
                "\t\t\t<td rowspan=\"1\">女</td>\n" +
                "            <td rowspan=\"1\">16</td>\n" +
                "            <td rowspan=\"1\">大中学</td>\n" +
                "            <td rowspan=\"1\">高一</td>\n" +
                "\t\t\t<td rowspan=\"1\">Ying </td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-25</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>家长对Miss Porter的课程感兴趣，需要安排测试，家长目前还没有确认好可以测试的时间。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">6</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-23</td>\n" +
                "\t\t\t<td rowspan=\"1\">苏</td>\n" +
                "\t\t\t<td rowspan=\"1\">1347885</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Mia // 米娅</td>\n" +
                "\t\t\t<td rowspan=\"1\">女</td>\n" +
                "            <td rowspan=\"1\">12</td>\n" +
                "            <td rowspan=\"1\">清华际学校</td>\n" +
                "            <td rowspan=\"1\">7</td>\n" +
                "\t\t\t<td rowspan=\"1\">Ying樱</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-25</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>学生对miss porter的TIE课程感兴趣，已经预约了今天下午6:30的线上测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">7</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">Nini介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">Nini</td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-22</td>\n" +
                "\t\t\t<td rowspan=\"1\">Sophia妈妈---删除</td>\n" +
                "\t\t\t<td rowspan=\"1\">185000</td>\n" +
                "\t\t\t<td rowspan=\"1\">zoe.宏</td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">八岁爬藤课程 Young Learner</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"2\">8</td>\n" +
                "\t\t\t<td rowspan=\"2\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"2\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"2\">北京咨询小助手</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">2019-02-21</td>\n" +
                "\t\t\t<td rowspan=\"2\">唐女士</td>\n" +
                "\t\t\t<td rowspan=\"2\">132887</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "            <td rowspan=\"2\">Michael 一鸣</td>\n" +
                "\t\t\t<td rowspan=\"2\">女</td>\n" +
                "            <td rowspan=\"2\">8</td>\n" +
                "            <td rowspan=\"2\">哈罗</td>\n" +
                "            <td rowspan=\"2\">2年级</td>\n" +
                "\t\t\t<td rowspan=\"2\">Ying ZHAO // 赵樱</td>\n" +
                "\t\t\t<td rowspan=\"2\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying樱</td>\n" +
                "                <td>2019-02-22</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>安排了今天下午5:30新校区测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying 樱</td>\n" +
                "                    <td>2019-02-25</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>家长想在顺义上YL1， 或者试听，距离将台担心堵车。目前我们顺义只有YL2的开班，需要新组班。同时家长还希望跟国际学校的学生组班，不希望跟公立学校的孩子一起上课。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"2\">9</td>\n" +
                "\t\t\t<td rowspan=\"2\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"2\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">客户口碑介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">赵老师学生</td>\n" +
                "\t\t\t<td rowspan=\"2\">2019-02-20</td>\n" +
                "\t\t\t<td rowspan=\"2\">妈妈</td>\n" +
                "\t\t\t<td rowspan=\"2\">13978861</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "            <td rowspan=\"2\">Diana燕婉</td>\n" +
                "\t\t\t<td rowspan=\"2\">女</td>\n" +
                "            <td rowspan=\"2\">8</td>\n" +
                "            <td rowspan=\"2\">白小学</td>\n" +
                "            <td rowspan=\"2\">2</td>\n" +
                "\t\t\t<td rowspan=\"2\">Ying樱</td>\n" +
                "\t\t\t<td rowspan=\"2\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-21</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>约了今天下午四点的测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying 樱</td>\n" +
                "                    <td>2019-02-25</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>表示如果有开班就可以来上课。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"3\">10</td>\n" +
                "\t\t\t<td rowspan=\"3\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"3\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"3\">北京咨询小助手</td>\n" +
                "\t\t\t<td rowspan=\"3\"></td>\n" +
                "\t\t\t<td rowspan=\"3\">2019-02-19</td>\n" +
                "\t\t\t<td rowspan=\"3\">妈妈</td>\n" +
                "\t\t\t<td rowspan=\"3\">137321</td>\n" +
                "\t\t\t<td rowspan=\"3\"></td>\n" +
                "            <td rowspan=\"3\">Randy嘉一</td>\n" +
                "\t\t\t<td rowspan=\"3\">男</td>\n" +
                "            <td rowspan=\"3\">9</td>\n" +
                "            <td rowspan=\"3\">府学胡同小学</td>\n" +
                "            <td rowspan=\"3\">三年级</td>\n" +
                "\t\t\t<td rowspan=\"3\">Ying樱</td>\n" +
                "\t\t\t<td rowspan=\"3\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"3\"></td>\n" +
                "\t\t\t<td rowspan=\"3\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-19</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>已经预约了本周三下午四点华德测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying 樱</td>\n" +
                "                    <td>2019-02-22</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>周日上午10:00华德试听。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying 樱</td>\n" +
                "                    <td>2019-02-22</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>学生目前适合上ESL3， 如果有开班家长愿意安排孩子试听。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"2\">11</td>\n" +
                "\t\t\t<td rowspan=\"2\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"2\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"2\">北京咨询小助手</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">2019-02-19</td>\n" +
                "\t\t\t<td rowspan=\"2\">黄妈妈</td>\n" +
                "\t\t\t<td rowspan=\"2\">130946</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "            <td rowspan=\"2\">Katrin 靖</td>\n" +
                "\t\t\t<td rowspan=\"2\">男</td>\n" +
                "            <td rowspan=\"2\">12</td>\n" +
                "            <td rowspan=\"2\">清华附中国际部</td>\n" +
                "            <td rowspan=\"2\">六年级</td>\n" +
                "\t\t\t<td rowspan=\"2\">Ying 樱</td>\n" +
                "\t\t\t<td rowspan=\"2\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-21</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>学生已经完成了线上测试，目前适合上ESL3， 家长觉得距离非常远，也想试听课程，如果有开班联系家长。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying樱</td>\n" +
                "                    <td>2019-02-25</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>家长住在西二旗附近，到这里基本上要2个小时左右，觉得非常远，基本不考虑春季过来上课。对我们的小说阅读课很感兴趣，觉得如果我们暑假有相关的开课计划可以联系家长。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"2\">12</td>\n" +
                "\t\t\t<td rowspan=\"2\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"2\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">客户口碑介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">杨春</td>\n" +
                "\t\t\t<td rowspan=\"2\">2019-02-19</td>\n" +
                "\t\t\t<td rowspan=\"2\">银</td>\n" +
                "\t\t\t<td rowspan=\"2\">1590806</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "            <td rowspan=\"2\">Andy 扬</td>\n" +
                "\t\t\t<td rowspan=\"2\">男</td>\n" +
                "            <td rowspan=\"2\">14</td>\n" +
                "            <td rowspan=\"2\">朝阳爱迪国际学校</td>\n" +
                "            <td rowspan=\"2\">九年级</td>\n" +
                "\t\t\t<td rowspan=\"2\">Ying 樱</td>\n" +
                "\t\t\t<td rowspan=\"2\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying 樱</td>\n" +
                "                <td>2019-02-19</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>明天下午线上测试。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying 樱</td>\n" +
                "                    <td>2019-02-22</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>本周日上午10:00华德RW试听。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"2\">13</td>\n" +
                "\t\t\t<td rowspan=\"2\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"2\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">客户口碑介绍</td>\n" +
                "\t\t\t<td rowspan=\"2\">杨春</td>\n" +
                "\t\t\t<td rowspan=\"2\">2019-02-19</td>\n" +
                "\t\t\t<td rowspan=\"2\">Jua</td>\n" +
                "\t\t\t<td rowspan=\"2\">1138822</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "            <td rowspan=\"2\">Jenny 仪</td>\n" +
                "\t\t\t<td rowspan=\"2\">女</td>\n" +
                "            <td rowspan=\"2\">15</td>\n" +
                "            <td rowspan=\"2\">二中分校</td>\n" +
                "            <td rowspan=\"2\">9年级</td>\n" +
                "\t\t\t<td rowspan=\"2\">Ying </td>\n" +
                "\t\t\t<td rowspan=\"2\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"2\"></td>\n" +
                "\t\t\t<td rowspan=\"2\">跟进中\n" +
                "            </td>\n" +
                "                <td>Ying ZHAO </td>\n" +
                "                <td>2019-02-19</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>预约了今天下午的线上测试，这是杨春的转介绍，学生目前已经申请了美高，对我们的PS和RW感兴趣，希望本周末可以安排试听。</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <tr align=\"center\">\n" +
                "                    <td>Ying ZHAO</td>\n" +
                "                    <td>2019-02-22</td>\n" +
                "                    <td>跟进中\n" +
                "                    </td>\n" +
                "                    <td><p>本周日上午10:00华德RW试听。</p></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                    <td></td>\n" +
                "                </tr>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">14</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-17</td>\n" +
                "\t\t\t<td rowspan=\"1\">士</td>\n" +
                "\t\t\t<td rowspan=\"1\">888888</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">菲</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">11</td>\n" +
                "            <td rowspan=\"1\">海淀公立小学</td>\n" +
                "            <td rowspan=\"1\">6</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">无</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">未跟进\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">15</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">员工介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">齐</td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-17</td>\n" +
                "\t\t\t<td rowspan=\"1\">萌</td>\n" +
                "\t\t\t<td rowspan=\"1\">17710201323</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Amanda 雨诗</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">7</td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie QI // 齐华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">八岁爬藤课程 Young Learner</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">16</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">客户口碑介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">齐老师学生介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-14</td>\n" +
                "\t\t\t<td rowspan=\"1\">杭妈妈</td>\n" +
                "\t\t\t<td rowspan=\"1\">1823007</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">George DONG // 杭</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">16</td>\n" +
                "            <td rowspan=\"1\">freshman the Shipley school</td>\n" +
                "            <td rowspan=\"1\">10</td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie QI // 齐亚华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">升学服务 Admissions Service</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">已成单\n" +
                "            </td>\n" +
                "                <td>Stephanie QI // 齐华</td>\n" +
                "                <td>2019-02-21</td>\n" +
                "                <td>跟进中\n" +
                "                </td>\n" +
                "                <td><p>成单</p></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">17</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">转介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">客户口碑介绍</td>\n" +
                "\t\t\t<td rowspan=\"1\">mark妈妈</td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-11</td>\n" +
                "\t\t\t<td rowspan=\"1\">妈妈</td>\n" +
                "\t\t\t<td rowspan=\"1\">1390962</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">YiJiang DONG // 江</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">18</td>\n" +
                "            <td rowspan=\"1\">成都七中高新校区</td>\n" +
                "            <td rowspan=\"1\">12</td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie QI // 齐亚华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">升学服务 Admissions Service</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">跟进中\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">18</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-11</td>\n" +
                "\t\t\t<td rowspan=\"1\">梅Cissy Mu</td>\n" +
                "\t\t\t<td rowspan=\"1\">1391151</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">Cissy的儿子</td>\n" +
                "\t\t\t<td rowspan=\"1\">女</td>\n" +
                "            <td rowspan=\"1\">11</td>\n" +
                "            <td rowspan=\"1\">北京京西学校</td>\n" +
                "            <td rowspan=\"1\">5</td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie QI // 齐华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">夏校咨询</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">未跟进\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "\t\t<tr align=\"center\">\n" +
                "            <td rowspan=\"1\">19</td>\n" +
                "\t\t\t<td rowspan=\"1\">旗舰校区 BJ Main Campus</td>\n" +
                "\t\t\t<td rowspan=\"1\">小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\">北京活动小助手</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">2019-02-06</td>\n" +
                "\t\t\t<td rowspan=\"1\">bb</td>\n" +
                "\t\t\t<td rowspan=\"1\">13513191</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\">未提供</td>\n" +
                "\t\t\t<td rowspan=\"1\">男</td>\n" +
                "            <td rowspan=\"1\">10</td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "            <td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">Stephanie QI // 齐华</td>\n" +
                "\t\t\t<td rowspan=\"1\" style=\"text-align: left;\">升学服务 Admissions Service</td>\n" +
                "\t\t\t<td rowspan=\"1\"></td>\n" +
                "\t\t\t<td rowspan=\"1\">未跟进\n" +
                "            </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td>\n" +
                "                </td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "                <td></td>\n" +
                "        </tr>\n" +
                "</table>\n" +
                "</body>\n" +
                "</html>\n";
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(new File("/Users/renjianjun/study/ideaWorkSpace/wlqq/download/a.xls"));
            HtmlToExcel htmlToExcel = new HtmlToExcel();
            htmlToExcel.htmlToExcel(fileOutputStream,ss,"aa");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

/**
 * @ClassName: TD td单元格实体类
 * @Description: 单元格类
 */
class TD {
    private int rowspan=1;
    private int colspan=1;
    private int x;
    private int y;
    private String content;

    public int getRowspan() {
        return rowspan;
    }
    public void setRowspan(int rowspan) {
        this.rowspan= rowspan;
    }
    public int getColspan() {
        return colspan;
    }
    public void setColspan(int colspan) {
        this.colspan= colspan;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content= content;
    }
    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x= x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y= y;
    }
}
